package main

import "fmt"

func init(){
	newElement(1,"Hydrogen","H",make([]int,1,-1),true)
	newElement(2,"Helium", "He", make([]int, 0),false)
	newElement(3,"Lithium", "Li", make([]int, 1),false)
	newElement(4,"Berylium", "Be", make([]int, 2),false)
	newElement(5,"Boron", "B", make([]int, 0),false)
	newElement(6,"Carbon", "C", make([]int, 0),false)
	newElement(7,"Nitrogen", "N", make([]int, -3),true)
	newElement(8,"Oxygen", "O", make([]int, -2),true)
	newElement(9,"Florine", "F", make([]int, -1),true)
	newElement(10,"Neon", "Ne", make([]int, 0),false)
}

func main() {
	NameElement("H")
//	fmt.Println(NameElement("H"))
}

type Element struct {
	name string
	symbol string
	Charge []int
}

func (element *Element) Name() string {
	return element.name
}
func (element *Element) Symbol() string {
	return element.symbol
}

var elements []Element

func newElement(atomicNumber int,name string, symbol string, charge []int, diatomic bool){
	element := Element{name,symbol,charge}
	elements[atomicNumber]=element
}

func NameElement(symbol string) string {
	for element := range elements {
/*		if element.Symbol()==symbol {
			return element.Name()
		}*/
		fmt.Println(element)
	}
	return ""
}
